package net.hanjava.roas;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

public class Xls2BundlesTask extends Task {
    private String xlsLocation;

    private String outputDir;

    public void setXlsLocation(String xlsLocation) {
        this.xlsLocation = xlsLocation;
    }

    public void setOutputDir(String outputDir) {
        this.outputDir = outputDir;
    }

    public void execute() throws BuildException {
        Book2Bundles b2b;
        try {
            b2b = new Book2Bundles(xlsLocation, outputDir);
            b2b.generate();
        } catch(Exception e) {
            throw new BuildException(e);
        }
    }

    public String getTaskName() {
        return "Xls2Bundle";
    }
}